package com.klangner.lucene.index
{
  import flash.utils.IDataInput;
  
  import mx.core.IDataRenderer; /**
  * Input reader with support for lucene primitive types (int32, vint etc.)
  */
  public class InputReader
  {
  	private var _input:IDataInput;
  	
  	/**
  	 * constructor
  	 */
    public function InputReader(input:IDataInput){
    	_input = input;
    }

    public function getInt32():int{
      return _input.readInt();
    }
    
    /**
    * This function reads 64bits value but returns it as 32bit int.
    * It shouldn't be a problem as long as index is not very large.
    * In the future there is need for special class handling 64bits int
    */
    public function getInt64():int{
      // Ignore first 32bits
      _input.readInt();
      return _input.readInt();
    }
  }
}